package goldberg.drew.twitter;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.concurrent.ConcurrentHashMap;
import java.text.DecimalFormat;
import java.util.concurrent.ExecutionException;

public abstract class AbstractTwitter {

 static BufferedReader reader;
 static ConcurrentHashMap<String, String> users = new ConcurrentHashMap<String, String>(); 
 public static ConcurrentHashMap createUsers() {
	try{    
	    reader = new BufferedReader(new FileReader("twitter_users.txt"));
	    final String topDirectory = "usersConcurrent/";
	    String userInfo = null;
	    int count = 0;
	    while(count < 9) {
	     	userInfo = reader.readLine();
		String userFilePath = topDirectory+userInfo;
		File userDirectory = new File(userFilePath);
	     	userDirectory.mkdirs();
		File file = new File(userFilePath+"/"+userInfo+".txt");
		if(!file.exists())
			file.createNewFile();
	     	users.put(userInfo, file.toString());
		count++; 
	    }
	    
	}
        catch(IOException e) {
	 	e.printStackTrace();
	}
	return users;
  }



}


